import 'package:flutter/material.dart';

class HexColor extends Color {

  static const String colorE4e4 = '#e4e4e4';

  static const String colorE58c = '#5E8CE2';

  static const String colorE9e9 = '#e9e9e9';

  static const String colorF878 = '#F87872';

  static const String color0064 = '#0064C8';

  static const String colorF59a = '#F59A23';

  static const String color6190 = '#6190e8';

  static const String color00c8 = '#00c8aa';

  static const String color3333 = '#333333';

  static const String colorFfc7 = '#FFC71C';

  static const String colorFf62 = '#ff6262';

  static const String colorCccc = '#cccccc';

  static const String color666e = '#666EE8';

  static const String colorF5f5 = '#F5F5F5';

  static const String colorFfff = '#FFFFFF';

  static const String color28d0 = '#28D094';

  static const String color9999 = '#999999';

  static const String colorF2f2 = '#F2F2F2';

  static const String colorE6e6 = '#E6E6E6';

  static const String colorF7f7 = '#F7F7F7';

  static const String colorFf00 = '#FF0000';

  static const String color6666 = '#666666';

  static const String color0e0e = '#0e0e0e';

  static const String color0000 = '#000000';

  static const String color1e1e = '#1E1E1E';

  static const String colorCc99 = '#CC9900';

  static const String colorF3fc = '#F3FCFB';

  static const String colorFcfc = '#FCFCFC';

  static const String colorF9f9 = '#F9F9F9';

  HexColor(final String hexColor) : super(_getColorFromHex(hexColor));

  static int _getColorFromHex(String hexColor) {
    hexColor = hexColor.toUpperCase().replaceAll('#', '');
    if (hexColor.length == 6) {
      hexColor = 'FF$hexColor';
    }
    return int.parse(hexColor, radix: 16);
  }

  static Color hex(String hex) {
    return HexColor(hex);
  }

  static Color rgba([
    int r = 255,
    int g = 255,
    int b = 255,
    double opacity = 1.0,
  ]) {
    return Color.fromRGBO(r, g, b, opacity);
  }

  static Color rgb([int r = 255, int g = 255, int b = 255]) {
    return rgba(r, g, b, 1.0);
  }
}
